<html><head><title>Break : Continue</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="5">Break : Continue</font></b></p>

<br><b>Syntax</b><blockquote><pre><font face="Courier New, Courier, mono"size="2"><b><font color="#3A3966">Break</font></b> [Level]
</font></pre></blockquote>
<b>Description</b><br><blockquote>


<b><font color="#3A3966">Break</font></b> provides the ability to exit during any iteration, for the following loops: 
<a href="repeat_until.html">Repeat</a>, <a href="for_next.html">For</a>, <a href="foreach_next.html">ForEach</a> and <a href="while_wend.html">While</a>. 
The optional 'level' parameter specifies the number of loops to exit from, given several nested loops. 
If no parameter is given, <b><font color="#3A3966">Break</font></b> exits from the current loop. 

</blockquote><p><b>Example:</b> Simple loop</p><blockquote>


<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#3A3966">For</font></b> k=0 <b><font color="#3A3966">To</font></b> 10
    <b><font color="#3A3966">If</font></b> k=5
      <b><font color="#3A3966">Break</font></b>  <font color="#3A3966">; Will exit directly from the For/Next loop</font>
    <b><font color="#3A3966">EndIf</font></b>
    <b><font color="#3A3966">Debug</font></b> k
  <b><font color="#3A3966">Next</font></b>
</font></pre>

</blockquote><p><b>Example:</b> Nested loops</p><blockquote>


<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#3A3966">For</font></b> k=0 <b><font color="#3A3966">To</font></b> 10
    Counter = 0
    <b><font color="#3A3966">Repeat</font></b>
      <b><font color="#3A3966">If</font></b> k=5
        <b><font color="#3A3966">Break</font></b> 2 <font color="#3A3966">; Will exit directly from the Repeat/Until and For/Next loops</font>
      <b><font color="#3A3966">EndIf</font></b>
      Counter+1
    <b><font color="#3A3966">Until</font></b> Counter &gt; 1
    <b><font color="#3A3966">Debug</font></b> k
  <b><font color="#3A3966">Next</font></b>
</font></pre>


</blockquote>
<br><b>Syntax</b><blockquote><pre><font face="Courier New, Courier, mono"size="2"><b><font color="#3A3966">Continue</font></b>
</font></pre></blockquote>
<b>Description</b><br><blockquote>


<b><font color="#3A3966">Continue</font></b> provides the ability to skip straight to the end of the current iteration 
(bypassing any code in between) in the following loops: 
<a href="repeat_until.html">Repeat</a>, <a href="for_next.html">For</a>, <a href="foreach_next.html">ForEach</a>, and <a href="while_wend.html">While</a>. 

</blockquote><p><b>Example</b></p><blockquote>


<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#3A3966">For</font></b> k=0 <b><font color="#3A3966">To</font></b> 10
    <b><font color="#3A3966">If</font></b> k=5
      <b><font color="#3A3966">Continue</font></b>  <font color="#3A3966">; Will skip the 'Debug 5' and go directly to the next iteration</font>
    <b><font color="#3A3966">EndIf</font></b>
    <b><font color="#3A3966">Debug</font></b> k
  <b><font color="#3A3966">Next</font></b>
</font></pre>
</body></html>